<template>
  <div>
    <el-row :gutter="20">
      <el-col :span="8">
        <el-card shadow="hover" class="mgb20">
          <div class="user-info">
            <img :src="$store.getters.getUserInfo.avatar" class="user-avator" alt />
            <div class="user-info-cont">
              <div class="user-info-name">{{ $store.getters.getUserInfo.username }}</div>
              <div>{{ $store.getters.getUserInfo.roles[0].name }}</div>
            </div>
          </div>

          <div class="user-info-list">
            <span class="left">电话:</span>
            <span>{{ $store.getters.getUserInfo.phone }}</span>
          </div>
        </el-card>
        <el-card shadow="hover">
          <template #header>
            <div class="clearfix">
              <span>语言详情</span>
            </div>
          </template>
          Vue
          <el-progress :text-inside="true" :stroke-width="26" :percentage="68.5" color="#42b983"></el-progress>Java
          <el-progress :text-inside="true" :stroke-width="26" :percentage="22" color="#f1e05a"></el-progress>JavaScript
          <el-progress :text-inside="true" :stroke-width="26" :percentage="1.8"></el-progress>HTML 、CSS
          <el-progress :text-inside="true" :stroke-width="26" :percentage="7.5" color="#f56c6c"></el-progress>
        </el-card>
      </el-col>
      <el-col :span="16">
        <el-card shadow="hover" style="min-height:403px;">
          <template #header>
            <div class="clearfix">
              <span>项目技术要点</span>
            </div>
          </template>

          <el-table :show-header="false" :data="todoList" style="width:100%;">
            <el-table-column prop="title">
              <template slot-scope="scope">
                <div>
                  <span>{{ scope.row.title }}</span>
                  <span style="display: inline-block; margin-left:30px;">{{ scope.row.desc }}</span>
                </div>
              </template>
            </el-table-column>
          </el-table>
        </el-card>
      </el-col>
    </el-row>
  </div>
</template>

<script>
export default {
  name: 'dashboard',
  data() {
    return {
      todoList: [
        {
          title: '后端框架：Springboot',
          desc: '主流的Java后端开发框架',
        },
        {
          title: '安全框架：Spring Security',
          desc: '后端安全框架',
        },
        {
          title: '测试和日志：Junit、Log4j',
          desc: '记录测试和日志',
        },
        {
          title: '前端：Vue 全家桶',
          desc: '主流的前端开发框架',
        },

        {
          title: '后台框架：vue-manage-system、 Element UI ',
          desc: 'vue-manage-system的开源框架改造',
        },

        {
          title: '数据存储：Mysql数据库',
          desc: '解决数据存储',
        },
        {
          title: '连接池：Druid',
          desc: '阿里开源的数据库连接池，mysql优化',
        },
      ],
    }
  },
}
</script>

<style scoped>
.el-row {
  margin-bottom: 20px;
}
.el-card {
  padding: 10px;
}

.grid-content {
  display: flex;
  align-items: center;
  height: 100px;
}

.grid-cont-right {
  flex: 1;
  text-align: center;
  font-size: 14px;
  color: #999;
}

.grid-num {
  font-size: 30px;
  font-weight: bold;
}

.grid-con-icon {
  font-size: 50px;
  width: 100px;
  height: 100px;
  text-align: center;
  line-height: 100px;
  color: #fff;
}

.grid-con-1 .grid-con-icon {
  background: rgb(45, 140, 240);
}

.grid-con-1 .grid-num {
  color: rgb(45, 140, 240);
}

.grid-con-2 .grid-con-icon {
  background: rgb(100, 213, 114);
}

.grid-con-2 .grid-num {
  color: rgb(45, 140, 240);
}

.grid-con-3 .grid-con-icon {
  background: rgb(242, 94, 67);
}

.grid-con-3 .grid-num {
  color: rgb(242, 94, 67);
}

.user-info {
  display: flex;
  align-items: center;
  padding-bottom: 20px;
  border-bottom: 2px solid #ccc;
  margin-bottom: 20px;
}

.user-avator {
  width: 120px;
  height: 120px;
  border-radius: 50%;
}

.user-info-cont {
  padding-left: 50px;
  flex: 1;
  font-size: 14px;
  color: #999;
}

.user-info-cont div:first-child {
  font-size: 30px;
  color: #222;
}

.user-info-list {
  font-size: 14px;
  color: #999;
  line-height: 25px;
  display: flex;
}
.user-info-list .left {
  display: inline-block;
  width: 6.125rem;
  margin: 0 10px;
}

.user-info-list span {
  margin-left: 5px;
}

.mgb20 {
  margin-bottom: 20px;
}

.todo-item {
  font-size: 14px;
}

.todo-item-del {
  text-decoration: line-through;
  color: #999;
}

.schart {
  width: 100%;
  height: 300px;
}
</style>
